﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;
using System.Drawing;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
using System.Web.Helpers;

namespace myFinance.BLL
{
    public class ImagemBll
    {
        public static WebImage CropImage(int top, int left, int bottom, int right, int thumbWidth, int thumbHeight, WebImage image)
        {
            var height = image.Height;
            var width = image.Width;

            image.Crop(top, left, (int)height - bottom, (int)width - right);
            image.Resize(thumbWidth, thumbHeight, true, false);

            return image;
        }
    }
}